package com.woody.aggregate.settings.api;

import com.woody.aggregate.settings.req.SaveSysCategoryConfigReq;
import com.woody.aggregate.settings.vo.SysCategoryConfigDetailVo;
import com.woody.aggregate.settings.vo.SysCategoryConfigSaveVo;
import com.woody.base.model.Response;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;
import java.util.List;

/**
 * &copy; All rights Reserved
 *
 * @author wénkǎi.zhāng 2025-03-18
 */
public interface CategoryConfigApi {

    @GetMapping("list/{bizType}")
    @ApiOperation(value = "分类列表查询", notes = "分类列表查询")
    @ApiImplicitParam(name = "bizType", value = "业务类型", required = true)
    Response<List<SysCategoryConfigDetailVo>> listCategoryConfig(@PathVariable(value = "bizType") Integer bizType);

    @PostMapping("save")
    @ApiOperation(value = "新增/编辑分类", notes = "新增/编辑分类")
    Response<SysCategoryConfigSaveVo> saveCategoryConfig(@Valid @RequestBody SaveSysCategoryConfigReq request);

    @DeleteMapping("delete/{categoryId}")
    @ApiOperation(value = "根据分类id删除分类及子分类", notes = "根据分类id删除分类及子分类，如果当前分类或子分类已有规则数据，不允许删除")
    @ApiImplicitParam(name = "categoryId", value = "分类id", required = true)
    Response<Void> deleteCategoryConfig(@PathVariable(value = "categoryId") Integer categoryId);

}
